package com.clp.protocol.iec104.client.pipeline.codec;

import com.clp.protocol.iec104.apdu.Apdu;
import com.clp.protocol.iec104.client.Master;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;

public class ApduToBytesEncoder extends MessageToByteEncoder<Apdu> {
    private final Master master;

    public ApduToBytesEncoder(Master master) {
        this.master = master;
    }

    @Override
    protected void encode(ChannelHandlerContext ctx, Apdu apdu, ByteBuf out) throws Exception {
        apdu.writeTo(out);
    }
}
